var FMFPdxfParserEntititiesMText = Class.create();
FMFPdxfParserEntititiesMText.prototype = {
    initialize: function (parseHelpers) {
        this.helpers = parseHelpers;
    },

    ForEntityName: 'MTEXT',

    parseEntity: function (scanner, curr) {
        var self = this;
        var entity = { type: curr.value };
        curr = scanner.next();
        while (curr !== 'EOF') {
            if (curr.code === 0) break;

            switch (curr.code) {
                case 3:
                    entity.text ? entity.text += curr.value : entity.text = curr.value;
                    break;
                case 1:
                    entity.text ? entity.text += curr.value : entity.text = curr.value;
                    break;
                case 7:
                    entity.textStyle = curr.value;
                    break;
                case 10:
                    entity.position = self.helpers.parsePoint(scanner);
                    break;
                case 40:
                    //Note: this is the text height
                    entity.height = curr.value;
                    break;
                case 41:
                    entity.width = curr.value;
                    break;
                case 50:
                    entity.rotation = curr.value;
                    break;
                case 71:
                    entity.attachmentPoint = curr.value;
                    break;
                case 72:
                    entity.drawingDirection = curr.value;
                    break;
                default:
                    self.helpers.checkCommonEntityProperties(entity, curr);
                    break;
            }
            curr = scanner.next();
        }
        return entity;
    },

    type: 'FMFPdxfParserEntititiesMText'
};